﻿CREATE TABLE [dbo].[UserTenants]
(
	[UserId]	[BIGINT]	NOT NULL,
	[TenantId]	[BIGINT]	NOT NULL,
	[CreatedAt]	[DATETIME]	NOT NULL,
	CONSTRAINT PK_UserTenants PRIMARY KEY ([UserId], [TenantId]),
	CONSTRAINT FK_UserTenants_Users FOREIGN KEY ([UserId]) REFERENCES [dbo].[Users]([Id]),
	CONSTRAINT FK_UserTenants_Tenants FOREIGN KEY ([TenantId]) REFERENCES [dbo].[Tenants]([Id])
)
